import psycopg2
import import_db_info


class DB:

    def __init__(self) -> None:
        self.conn = psycopg2.connect(**import_db_info.sdata)
        self.cur = self.conn.cursor()

    def exec(self, sql: str):
        self.cur.execute(sql)

    def commit(self):
        self.conn.commit()

    def close(self):
        self.cur.close()
        self.conn.close()
